#ifndef prs_FrmFont_H
#define prs_FrmFont_H

#include "frm_TFont.h"
#include "prs_GrfColor.h"

namespace prs {

///////////////////////////////////////////////////////////////////////////////

struct TRuleFrmFont : public snt::TRule
{
  TRuleFrmFont(snt::text::TContext &Context,svl::TVariant &VFont);
  
private:  
  static TRuleFrmFont &GetThis(svl::TVariant &VThis) { return *dynamic_cast<TRuleFrmFont*>(VThis.Pointer());}
  frm::TFont &GetFont();
  //
  static void FName  (snt::TParams &Params) { GetThis(Params[0]).GetFont().Name  .SetValue(Params[1].String ()); }
  static void FHeight(snt::TParams &Params) { GetThis(Params[0]).GetFont().Height.SetValue(Params[1].Integer()); }
  static void FColor (snt::TParams &Params);
  //
  struct TSetStyle : public snt::text::TSequence::TEvents
  {
    TRuleFrmFont &Rule; 
    //
    TSetStyle(TRuleFrmFont &Rule_) : Rule(Rule_) {}
    virtual bool TEvents_DoEntry(snt::text::TSequence &Sequence,svl::TString &OutError);
    svl_Except;
  }
  setStyle;
  //
  svl::TVariant &vFont,vThis,vString,vNumber;//,vR,vG,vB;
  snt::TAlter    A,AStyle1,AStyle2;
  snt::TRule     /*RColor,*/RStyle;
  TRuleGrfColor RColor; svl::TVariant vColor; grf::TColor color;
  svl_Except;
};

///////////////////////////////////////////////////////////////////////////////
}

#endif
